Skip to content
Snippets Groups Projects
Commit 415be01e authored by Ivar Härnqvist's avatar Ivar Härnqvist
Browse files

fix cmake build output directory on windows

parent 66a79f9c
No related branches found
No related tags found
3 merge requests!67WIP: B-ASIC version 1.0.0 hotfix,!65B-ASIC version 1.0.0,!15Add changes from sprint 1 and 2 to master
...@@ -27,4 +27,5 @@ ehthumbs_vista.db ...@@ -27,4 +27,5 @@ ehthumbs_vista.db
$RECYCLE.BIN/ $RECYCLE.BIN/
*.stackdump *.stackdump
[Dd]esktop.ini [Dd]esktop.ini
*.egg-info *.egg-info
\ No newline at end of file __pycache__/
\ No newline at end of file
...@@ -12,24 +12,26 @@ find_package(pybind11 CONFIG REQUIRED) ...@@ -12,24 +12,26 @@ find_package(pybind11 CONFIG REQUIRED)
set(LIBRARY_NAME "b_asic") set(LIBRARY_NAME "b_asic")
set(TARGET_NAME "_${LIBRARY_NAME}") set(TARGET_NAME "_${LIBRARY_NAME}")
if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
include(GNUInstallDirs) include(GNUInstallDirs)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_INSTALL_LIBDIR}") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_INSTALL_LIBDIR}")
endif() endif()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_PDB_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_PDB_OUTPUT_DIRECTORY_DEBUG "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_PDB_OUTPUT_DIRECTORY_RELEASE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
add_library( pybind11_add_module(
"${TARGET_NAME}" MODULE
"${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp"
)
add_library(
"${TARGET_NAME}:${TARGET_NAME}"
ALIAS "${TARGET_NAME}"
)
set_target_properties(
"${TARGET_NAME}" "${TARGET_NAME}"
PROPERTIES "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp"
PREFIX ""
) )
target_include_directories( target_include_directories(
...@@ -47,14 +49,14 @@ target_compile_options( ...@@ -47,14 +49,14 @@ target_compile_options(
"${TARGET_NAME}" "${TARGET_NAME}"
PRIVATE PRIVATE
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>>: $<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>>:
-W -Wall -Wextra -Werror -Wno-psabi -fvisibility=hidden -W -Wall -Wextra -Werror -Wno-psabi
$<$<CONFIG:Debug>:-g> $<$<CONFIG:Debug>:-g>
$<$<NOT:$<CONFIG:Debug>>:-O3> $<$<NOT:$<CONFIG:Debug>>:-O3 -flto>
> >
$<$<CXX_COMPILER_ID:MSVC>: $<$<CXX_COMPILER_ID:MSVC>:
/W3 /WX /permissive- /utf-8 /W3 /WX /permissive- /utf-8 /bigobj
$<$<CONFIG:Debug>:/Od> $<$<CONFIG:Debug>:/Od>
$<$<NOT:$<CONFIG:Debug>>:/Ot> $<$<NOT:$<CONFIG:Debug>>:/Ot /GL /LTCG>
> >
) )
...@@ -62,7 +64,6 @@ target_link_libraries( ...@@ -62,7 +64,6 @@ target_link_libraries(
"${TARGET_NAME}" "${TARGET_NAME}"
PRIVATE PRIVATE
fmt::fmt-header-only fmt::fmt-header-only
pybind11::module
) )
add_custom_target( add_custom_target(
......
MIT License MIT License
Copyright (c) 2020 TDDD96 Copyright (c) 2020 TDDD96 PUM4
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
...@@ -43,26 +43,26 @@ cmake --build . --config Release ...@@ -43,26 +43,26 @@ cmake --build . --config Release
The output gets written to `B-ASIC/build/lib`. The output gets written to `B-ASIC/build/lib`.
### Using setuptools to create a package ### Using setuptools to create a package
How to create a package using setuptools. How to create a package using setuptools that can be installed using pip.
#### Setup (Binary distribution) #### Setup (Binary distribution)
In `B-ASIC`: In `B-ASIC`:
``` ```
python3 setup.py bdist_wheel python3 setup.py bdist_wheel
``` ```
The output gets written to `B-ASIC/dist`. The output gets written to `B-ASIC/dist/b_asic-<version>-<python_tag>-<abi_tag>-<platform_tag>.whl`.
#### Setup (Source distribution) #### Setup (Source distribution)
In `B-ASIC`: In `B-ASIC`:
``` ```
python3 setup.py sdist python3 setup.py sdist
``` ```
The output gets written to `B-ASIC/dist`. The output gets written to `B-ASIC/dist/b-asic-<version>.tar.gz`.
#### Installation (Binary distribution) #### Installation (Binary distribution)
In `B-ASIC`: In `B-ASIC`:
``` ```
python3 -m pip install b_asic-<version>-<cpver>-<cpver>_<arch>.whl python3 -m pip install b_asic-<version>-<python_tag>-<abi_tag>-<platform_tag>.whl
``` ```
#### Installation (Source distribution) #### Installation (Source distribution)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment