Generate two Visual Studio Solutions at same folder using CMake - visual-studio-2010

Using CMake, I am trying to this:
Create two Visual Studio solutions at same folder.
eg.:
root
|
|-- myproject.sln
|-- myproject_x64.sln
Generated with command line (.bat file):
cmake -G"Visual Studio 10"
del CMakeCache.txt // POG to generate win64 in the sequence "CMake ZERO_CHECK will cry"
cmake -G"Visual Studio 10 Win64"
Inside cmake file:
PROJECT(myproject)
IF(NOT "${CMAKE_CL_64}" MATCHES "0")
MESSAGE( STATUS "Generating x64 Solution...")
PROJECT(myproject_x64)
ELSE()
MESSAGE( STATUS "Generating x86 Solution...")
ENDIF()
(...)
Is it possible to do something like this ?
The CMake always generate ALL_BUILD project resulting this:
root
|-- source/header files
|-- unittest.vcxproj
|
|-- ALL_BUILD.vcxproj (used for last generated project)
|-- myproject.sln
|-- myproject_x64.sln
Is there a way to create subdirectories for (ALL_BUILD.vcxproj,INSTALL.vcxproj,PACKAGE.vcxproj, ZERO_CHECK.vcxproj) ?
eg.:
root
|-- source/header files
|-- unittest.vcxproj
|
|-- myproject.sln
|-- myproject_x64.sln
|
|---- depDir
|
| (used for myproject)
|-- ALL_BUILD.vcxproj
|-- INSTALL.vcxproj
|-- PACKAGE.vcxproj
|-- ZERO_CHECK.vcxproj
|---- depDir_x64
|
| (used for myproject_x64)
|-- ALL_BUILD.vcxproj
|-- INSTALL.vcxproj
|-- PACKAGE.vcxproj
|-- ZERO_CHECK.vcxproj
OR "preferable"
root
|-- source/header files
|-- unittest.vcxproj
|
|-- myproject.sln
|-- myproject_x64.sln
|
|-- ALL_BUILD.vcxproj (used for myproject)
|-- INSTALL.vcxproj (used for myproject)
|-- PACKAGE.vcxproj (used for myproject)
|-- ZERO_CHECK.vcxproj
|
|---- depDir_x64
|
| (used for myproject_x64)
|-- Additional CMakeLists.txt if needed.
|-- ALL_BUILD.vcxproj
|-- INSTALL.vcxproj
|-- PACKAGE.vcxproj
|-- ZERO_CHECK.vcxproj
Is it possible to do something like this ?

I found a good alternative!
I create a .bat file to generate x86, x64 folders and use a single CMakeLists file.
#echo off
echo Generating x86 Solution...
mkdir x86
cd x86
cmake -G"Visual Studio 10" "../"
cd ..
mkshortcut "../" /target:"%~dp0\x86\myproject.sln" /shortcut:"myproject.sln"
echo Generating x64 Solution...
mkdir x64
cd x64
cmake -G"Visual Studio 10 Win64" "../"
cd ..
mkshortcut "../" /target:"%~dp0\x64\myproject.sln" /shortcut:"myproject_x64.sln"
pause
Using
cd x86
and
cmake "../"
I can generate files inside x86 folder.
The result is:
root
|-- source/header files
|-- x86 <- folder
|-- x64 <- folder
|-- CMakeLists.txt
|-- myproject.sln <-shortcut to x86 .sln
|-- myproject_x64.sln <-shortcut to x64 .sln
The code to create shortcut file
mkshortcut "../" /target:"%~dp0\x86\myproject.sln" /shortcut:"myproject.sln"
Uses mkshortcut.vbs taken from giannistsakiris.com
rem This code is used to generate files shortcuts
rem eg.:
rem mkshortcut /target:"c:\myfile" /shortcut:"c:\myfileShortcut"
set WshShell = WScript.CreateObject("WScript.Shell" )
set oShellLink = WshShell.CreateShortcut(Wscript.Arguments.Named("shortcut") & ".lnk")
oShellLink.TargetPath = Wscript.Arguments.Named("target")
oShellLink.WindowStyle = 1
oShellLink.Save
To see if cmake -G"Visual Studio 10 Win64" was used:
IF(NOT "${CMAKE_CL_64}" MATCHES "0")
...

Related

How to configure Gradle for a Kotlin multi-platform project with multiple targets?

For my Kotlin JVM project I have 2 different implementations for expected declarations of classes/functions. I'm using Kotlin multi-platform features with the expect/actual system. Here's the project structure:
|-- actual1 (sub-module)
|-- src/ (actual declarations for the first target)
|-- build.gradle
|-- actual2 (sub-module)
|-- src/ (actual declarations for the second target)
|-- build.gradle
|-- src/ (common code + expected declarations)
|-- build.gradle
How should I go about configuring Gradle such that I can switch between using actual1 or actual2 at compile time with for example a compiler flag?

Spring CLI generates unexpected project structure

When I generate a project with the webpage https://start.spring.io/ and with the configuration: ["group: com.foo", "artifact: bar", "build: maven", "spring boot version: 1.4.2"] I get the following project structure:
folder-name/
|-- mvnw
|-- mvnw.cmd
|-- pom.xml
|-- src
|-- main
| |-- java
| | |-- com
| | |-- foo
| | |--BarApplication.java
| |-- resources
| |-- application.properties
|-- test
|-- java
|-- com
|-- foo
|--BarApplicationTests.java
And when I generate a project with the Spring CLI command:
"spring init -g=com.foo -a=bar -name=bar --build=maven foo-bar" I get the following project structure:
folder-name/
|-- mvnw
|-- mvnw.cmd
|-- pom.xml
|-- src
|-- main
| |-- java
| | |-- com
| | |-- example
| | |--BarApplication.java
| |-- resources
| |-- application.properties
|-- test
|-- java
|-- com
|-- example
|--BarApplicationTests.java
Whatever config I use with Spring CLI. I always get the folder structure "src/java/{top-level domain}/example".
Why is the folder after the top-level domain always named "example", how do I avoid this so that it uses the group and artifact properly so that I get: "src/java/{group's top-level domain}/{group's domain}"?
I guess -a and -g are not correct spring cli params. Only name works fine.
Please referr to How do I use the Paremeters listed in spring init --list.
Specifying the --package-name parameter solved it.

Can't create unittests IntelliJ

I am not able to select my testfolder in IntelliJ.
For some reason it wasn't there when I created this project, so I added it manually. After I did that, I went to project structure --> modules, where I marked it as a test.
I am simply not allowed to leave my source directory, when creating a testcase.
See image:
The problem doesn't occure when I create a new project, where the testfolder is set automaticly.
It seems that you have wrong project structure.
It should be as follows:
project-name
|-- pom.xml
|-- src
|-- main
| |-- java
| |-- resources
|-- test
|-- java
|-- resources
And don't mark the test directory as a test source root. You should mark the test/java (subdirectory under the test folder) instead:

How to maven multiple directories in java?

Im having 2 seperate packages under src folder. i wonder how to maven this project?
src
-- com.firstpackage
-- com.secondPackage
As long as they are in one src folder this should not be a problem.
Your typical maven project will look like this:
my-app
|-- pom.xml
`-- src
|-- main
| `-- java
| `-- com
| `-- mycompany
| `-- app
| `-- App.java
`-- test
`-- java
`-- com
`-- mycompany
`-- app
`-- AppTest.java
So even if you have many packages/folders within src/ that should be no problem.
There is a good guide here how to set up a maven project in 5 mintues.

Rails 3.1 asset pipeline vendor/assets folder organization

I'm using the jQuery Tools scrollable library in my Rails 3.1 site with the various assets placed in the vendor/assets folder and it works great.
My question is regarding the best way to organize the various files under vendor/assets. What is the recommended way to organize vendor/assets subfolders? Currently I have this structure:
vendor/assets/
|-- images/
| |-- scrollable/
| <various button/gradient images>
|-- javascripts/
| |-- scrollable/
| jquery.tools.min.js
|-- stylesheets/
| |-- scrollable/
| scrollable-buttons.css
| scrollable-horizontal.css
This is a fairly un-DRY what to do this. I feel that all of the 'scrollable' items should be under one folder.
What is the recommended way to do this without having to manipulate the asset pipeline load paths?
Thanks!
You could organise them this way, which is slightly better in that it keeps stuff related to the plugin in one directory:
vendor/assets/scrollable
|-- images/
| |-- <various button/gradient images>
|-- javascripts/
| |-- jquery.tools.min.js
|-- stylesheets/
| |-- scrollable-buttons.css
| scrollable-horizontal.css
I am pretty sure this will work as rails globs all directories under assets/.

Resources